package Com.amit.Collection;

import java.util.Iterator;
import java.util.PriorityQueue;

public class Lab22 {

	
	public static void main(String[] args) {
		
		PriorityQueue al=new PriorityQueue();
		
		al.add("amit");
		al.add("anil");
		al.add("ajay");
		al.add("amit");
		al.add("ak");
		
		System.out.println("head:"+al.element());
		System.out.println("head:"+al.peek());
		
		Iterator itr=al.iterator();
		while(itr.hasNext())
		{
			System.out.println(itr.next());
		}
		
		System.out.println("After removing two element");
		al.remove();
		al.poll();
		
		Iterator itr1=al.iterator();
		while(itr1.hasNext())
		{
			System.out.println(itr1.next());
		}
		
		
	}

}
